package com.centit.ideaInfo.po;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.validator.constraints.Length;

import com.centit.framework.components.CodeRepositoryUtil;
import com.centit.framework.model.basedata.IUnitInfo;
import com.centit.framework.model.basedata.IUserInfo;
@Entity
@Table(name = "T_IDEA_INFO")
public class IdeaInfo implements java.io.Serializable{

	/**
	 * REC_ID 主键 
	 */
	@Id
	@Column(name = "REC_ID")
	
	private String recId;
	
	/**
	 * FLOW_REC_ID 标题 
	 */
	@Column(name = "FLOW_REC_ID")
	@Length(min = 0, max = 32, message = "字段长度不能小于{min}大于{max}")
	private String flowRecId;
	
	/**
	 * USER_CODE  操作人
	 */
	@Column(name = "USER_CODE")
	@Length(min = 0, max = 32, message = "字段长度不能小于{min}大于{max}")
	private String userCode;
	
	/**
	 * USER_NAME 操作人姓名 
	 */
	@Column(name = "USER_NAME")
	@Length(min = 0, max = 255, message = "字段长度不能小于{min}大于{max}")
	private String userName;
	
	/**
	 * UNIT_CODE 操作人部门 
	 */
	@Column(name = "UNIT_CODE")
	@Length(min = 0, max = 32, message = "字段长度不能小于{min}大于{max}")
	private String unitCode;
	
	/**
	 * UNIT_NAME 操作人部门名称 
	 */
	@Column(name = "UNIT_NAME")
	@Length(min = 0, max = 255, message = "字段长度不能小于{min}大于{max}")
	private String unitName;
	
	/**
	 * CREATE_TIME 操作时间 
	 */
	@Column(name = "CREATE_TIME")
	private Date createTime;
	

	/**
	 * CREATE_TIME 操作时间 
	 */
	@Column(name = "UPDATE_TIME")
	private Date updateTime;
	
	/**
	 * IDEA_CODE 办理方式 1 上报，2转办，3自办，4驳回 
	 */
	@Column(name = "IDEA_CODE")
	@Length(min = 0, max = 10, message = "字段长度不能小于{min}大于{max}")
	private String ideaCode;
	
	/**
	 * DATA_VALID 数据有效性 T有效 F 无效 
	 */
	@Column(name = "DATA_VALID")
	@Length(min = 0, max = 1, message = "字段长度不能小于{min}大于{max}")
	private String dataValid;
	
	/**
	 * FJ_FILE 附件 
	 */
	@Column(name = "FJ_FILE")
	@Length(min = 0, max = 2000, message = "字段长度不能小于{min}大于{max}")
	private String fjFile;
	
	/**
	 * CONTENT  办理意见
	 */
	@Column(name = "CONTENT")
	@Length(min = 0, max = 2000, message = "字段长度不能小于{min}大于{max}")
	private String content;
	/**
	 * AIR_REC_ID 航空器ID
	 */
	@Column(name = "AIR_REC_ID")
	@Length(min = 0, max = 32, message = "字段长度不能小于{min}大于{max}")
	private String airRecID;
	/**
	 * IDEA_TYPE  日志类型
	 */
	@Column(name = "IDEA_TYPE")
	@Length(min = 0, max = 255, message = "字段长度不能小于{min}大于{max}")
	private String ideaType;
	
	
	
	
	
	public IdeaInfo() {}
	
	public IdeaInfo(String recId) {
		this.recId=recId;
	}
	public IdeaInfo(String recId,String flowRecId,IUserInfo user,IUnitInfo unit,String ideaCode,Date createTime,String airRecId,String ideaType){
		this.recId=recId;
		this.flowRecId=flowRecId;
		this.createTime=new Date();
		this.userCode=user.getUserCode();
		this.userName=user.getUserName();
		this.unitCode=user.getPrimaryUnit();
		this.unitName=unit.getUnitName();
		this.updateTime=createTime;
		this.dataValid="T";
		this.ideaCode=ideaCode;
		this.airRecID=airRecId;
		this.ideaType=ideaType;
	}
	
	public IdeaInfo(String recId, @Length(min = 0, max = 32, message = "字段长度不能小于{min}大于{max}") String flowRecId,
			@Length(min = 0, max = 32, message = "字段长度不能小于{min}大于{max}") String userCode,
			@Length(min = 0, max = 255, message = "字段长度不能小于{min}大于{max}") String userName,
			@Length(min = 0, max = 32, message = "字段长度不能小于{min}大于{max}") String unitCode,
			@Length(min = 0, max = 255, message = "字段长度不能小于{min}大于{max}") String unitName, Date createTime,
			@Length(min = 0, max = 10, message = "字段长度不能小于{min}大于{max}") String ideaCode,
			@Length(min = 0, max = 1, message = "字段长度不能小于{min}大于{max}") String dataValid,
			@Length(min = 0, max = 2000, message = "字段长度不能小于{min}大于{max}") String fjFile,
			@Length(min = 0, max = 2000, message = "字段长度不能小于{min}大于{max}") String content) {
		super();
		this.recId = recId;
		this.flowRecId = flowRecId;
		this.userCode = userCode;
		this.userName = userName;
		this.unitCode = unitCode;
		this.unitName = unitName;
		this.createTime = createTime;
		this.ideaCode = ideaCode;
		this.dataValid = dataValid;
		this.fjFile = fjFile;
		this.content = content;
	}

	public String getRecId() {
		return recId;
	}

	public void setRecId(String recId) {
		this.recId = recId;
	}

	public String getFlowRecId() {
		return flowRecId;
	}

	public void setFlowRecId(String flowRecId) {
		this.flowRecId = flowRecId;
	}

	public String getUserCode() {
		return userCode;
	}

	public void setUserCode(String userCode) {
		this.userCode = userCode;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getUnitCode() {
		return unitCode;
	}

	public void setUnitCode(String unitCode) {
		this.unitCode = unitCode;
	}

	public String getUnitName() {
		return unitName;
	}

	public void setUnitName(String unitName) {
		this.unitName = unitName;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public String getIdeaCode() {
		return ideaCode;
	}

	public void setIdeaCode(String ideaCode) {
		this.ideaCode = ideaCode;
	}

	public String getDataValid() {
		return dataValid;
	}

	public void setDataValid(String dataValid) {
		this.dataValid = dataValid;
	}

	public String getFjFile() {
		return fjFile;
	}

	public void setFjFile(String fjFile) {
		this.fjFile = fjFile;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	public String getAirRecID() {
		return airRecID;
	}

	public void setAirRecID(String airRecID) {
		this.airRecID = airRecID;
	}

	public String getIdeaType() {
		return ideaType;
	}

	public void setIdeaType(String ideaType) {
		this.ideaType = ideaType;
	}
	
	
}
